package com.example.demo.service;

import com.example.demo.mapper.LogInfoMapper;
import com.example.demo.model.LogInfo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: fzykd
 * Date: 2022-11-01
 * Time: 19:47
 */

@Service
public class LogInfoService {
    @Resource
    private LogInfoMapper logInfoMapper;

    @Transactional(propagation = Propagation.REQUIRES_NEW)

    public int add(LogInfo logInfo){
        int num = 10/0;
        return logInfoMapper.add(logInfo);
    }
}
